package cl.ufro.dis.ttmic;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView;



public class SeleccionAlumno extends ListActivity{

	
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		
		
		super.onCreate(savedInstanceState);

		
		String[] alumnos = new String[]{"Carlos Ossandon","Cecilia Ossandon"};
		
		
		
		 setListAdapter(new ArrayAdapter<String>(this, R.layout.seleccionalumno, alumnos));

		  ListView lv = getListView();
		  lv.setTextFilterEnabled(true);
		  final Intent i = new Intent(this,Menu.class);
		  lv.setOnItemClickListener(new OnItemClickListener() {

			  
			public void onItemClick(AdapterView<?> parent, View view, int position,
					long id) {
				// TODO Auto-generated method stub
				Toast.makeText(getApplicationContext(), ((TextView) view).getText(),
				Toast.LENGTH_SHORT).show();
				startActivity(i);
			}
		});
		  
		
	}

	

//
//	@Override
//	protected void onResume() {
//
//		super.onResume();	
//		
//		String[] alumnos = new String[3];
//		alumnos[0] = "Carlos Ossandón";
//		alumnos[1] = "Cecilia Ossandón";
//		
//		setListAdapter(new ArrayAdapter<String>(this, R.layout.seleccionalumno, alumnos));
//		ListView listadoTiendas = getListView();
//		listadoTiendas.setTextFilterEnabled(true);
//		
//		
//	}
}
